#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/9/17 0:11
# @Author: 张涛
# @Email: xxx@gmail.com
# @File：chanpin_chakan_page.py

"""
产品详情页界面
"""
from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class DetailPage(BasePage):
    dwsc_locator = (By.XPATH,'/html/body/div[5]/div/div[2]/div[1]/div[1]/div/a[2]')  #定位删除按钮
    dwxg_locator = (By.XPATH,'/html/body/div[5]/div/div[2]/div[1]/div[1]/div/a[1]') #定位修改
    dwrz_locator = (By.XPATH,'/html/body/div[5]/div/div[1]/ul/li[3]/a') #点击日志
    dwrw_locator = (By.XPATH,'/html/body/div[5]/div/div[1]/ul/li[4]/a') #点击任务
    dwrc_locator = (By.XPATH,'/html/body/div[5]/div/div[1]/ul/li[5]/a') #定位日程


    def dwsc_element(self):
        '''点击删除'''
        self.driver.find_element(*self.dwsc_locator).click()
        self.driver.switch_to.alert.accept()  # 提示框选择确定

    def dwxg_element(self):
        '''点击修改'''
        self.driver.find_element(*self.dwxg_locator).click()

    def dwrz_element(self):
        '''点击日志'''
        self.driver.find_element(*self.dwrz_locator).click()

    def dwrw_element(self):
        '''定位任务'''
        self.driver.find_element(*self.dwrw_locator).click()

    def dwrc_element(self):
        '''定位日程'''
        self.driver.find_element(*self.dwrc_locator).click()
